﻿#ifndef BASESPECTROMETER_H
#define BASESPECTROMETER_H
#include <QIODevice>
#include <QVector>
#include <QThread>
#include <QTimer>
#include <QObject>

#include "dialogspectrometer.h"
#include "spectrometerdata.h"


//这是光谱仪基类/模拟类，
class BaseSpectroMeter:public QObject
{
    Q_OBJECT
public:
    BaseSpectroMeter();

    // BaseDevice interface
public:
    virtual void SetOtherConfig(QJsonObject config);

    static bool EnumSpectro(QList<AvsInfo> &listAvsInfo);
    virtual bool OpenSpectro();
    virtual bool CloseSpectro();

    virtual bool SetMeasureParam(AvsMeasPara param);
    virtual bool GetMeasParam(AvsMeasPara& param);        //获取内存中存在的测试参数
    const  double GetTemperature();

    const virtual QList<double> GetLambda();
    virtual SpectroInfoTag GetSpectrumInfo();
    virtual bool StartMeasure();
    virtual bool Stop();
    virtual bool SoftTrigger();

signals:
    void OnDataReceive(AvsMeasResult data);

protected:
    QVector<QPointF> GetPoints(const QList<double> &values);
    AvsMeasPara _measParam;
    int _deviceIndex;
    QString _serial;
    QTimer _timer;
    QList<double> _lambda;
    AvsMeasResult GetResult();
    AvsMeasResultList _specData;

public slots:
    void MyTimerEvent();

};

#endif // BASESPECTROMETER_H
